<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<jsp:directive.page import="DbUtil.DbUtil"/>

  <%
  String fid = request.getParameter("fid");
  String sessionBranch = session.getAttribute("BranchNo").toString();
  System.out.println("fid " + fid +"  sessionbranch " + sessionBranch);
  String sql="";
  if(!sessionBranch.equals("0"))
  {
  	sql = "select * from cq_cmn_branch where branchno='"+sessionBranch+"' and subcenterno="+fid;
  }
  else
  {
  	sql = "select * from cq_cmn_branch where branchno!='0' and subcenterno="+fid;
  }
  List list = DbUtil.getItems(sql); %>
	<select name="branchno" id="branchno">
	<option value="-1" <%if((request.getParameter("branchno")!=null)&&(request.getParameter("branchno").equals("-1"))) {out.print("selected");}%>>请选择支行</option>
	<%for (int i=0;i<list.size();i++){dto.Item item = (dto.Item)list.get(i); %>
		<option value="<%=item.getId()%>" <%if((request.getParameter("branchno")!=null)&&(request.getParameter("branchno").equals(item.getId()))) {out.print("selected");}%>><%=item.getName() %></option>
		<%} %>
	</select>